Skip to main content

Leaderboards

A leaderboard is a collection of user scores.

As part of your simulation, you might want to assign scores to the participants when they complete certain tasks. This could help you compare the participants' performance and assess the difficulty level of the sim.

To track the participants' scores, use a leaderboard.

learn more

Leaderboards are managed in the JS libraries with the Leaderboard adapter.

A leaderboard is scoped to an Epicenter entity. For example, you can create a leaderboard for a group of participants. In this case, the scope boundary is "GROUP" and the scope key is the groupKey (the group's GUID). Such a leaderboard is an array of objects, each containing an array of scores for a specific user.

Creating and updating

A score object has two properties:

  • "name": The metric evaluated by the score
  • "quantity": The score value

To identify the metric that is being scored, give the score a descriptive name. Save the score's numeric value in the quantity.

note

The score names must be unique for the user-specific scope.

When updating scores in a leaderboard, you must provide a user-specific scope. That way, Epicenter knows which user in the collection the scores belong to.

learn more

To create or update a leaderboard, call the update() function.

Tagging user scores

To facilitate a more granular search, create a subset of scores for a user by adding tags to a leaderboard. Tags are string pairs of the format "<tag_name>"="<tag_value>".

learn more

To search for scores with specific tags, call the list() function with a filter on tags. For example, to search for scores tagged with "role"="doctor", use this filter: filter: ['tag.role=doctor'].